<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>商城首页</title>
    <link rel="stylesheet" type="text/css" href="${basePath }/public/css/common.css">
    <link rel="stylesheet" type="text/css" href="${basePath}/public/js/swiper/swiper.min.css">
    <script type="text/javascript" src="${basePath}/public/js/jquery.min.js"></script>
    <script type="text/javascript" src="${basePath}/public/js/swiper/swiper.jquery.min.js"></script>
    <script>
        $(function(){
            var swiper = new Swiper('.swiper-container', {
                paginationClickable: true,
                speed: 3000,
                loop: true,
                observer:true,
                observeParents:true,
                autoplayDisableOnInteraction : false,
                autoplay:10000
            });
        });
    </script>

    <script type="text/javascript">
        function select() {
            var name = $("#a").val();
            window.location.href="${basePath}/home/homepage/like?name="+name;
        }
    </script>

</head>
<body>
<div class="top-header">
    <div class="section">
        <div class="top-header-left f-left">
            <a href="#">LOGO</a>
        </div>
        <div class="top-header-right f-right">
            <c:choose>
                <c:when test="${empty user}">
                    <a href="${basePath}/home/vipUser/toLogin">登录</a>
                    <a href="${basePath}/home/vipUser/toRegisterVip">注册</a>
                    <a href="${basePath}/admin/adminUser/toLogin">后台</a>
                </c:when>
                <c:otherwise>
                    <a href="#">欢迎你!<W style="color: bisque;font-weight: bold; font-family: 微软雅黑; font-size: 20px;">${user.username}</W></a>
                    <a href="${basePath}/admin/adminUser/toLogin">后台</a>
                    <a href="${basePath}/home/vipUser/write">注销</a>
                </c:otherwise>
            </c:choose>
        </div>
    </div>
</div>

<div class="section nav-header">
    <ul class="nav-menus f-left">
        <li><a href="${basePath}/home/homepage/index" class="active">首页</a></li>
        <li><a href="${basePath}/home/homepage/toProductList">产品列表</a></li>
        <li><a href="${basePath}/home/cart">购物车</a></li>
        <li><a href="${basePath}/home/vipUser/index" >会员中心</a></li>
        <li><a href="${basePath}/home/News/toNews">新闻资讯</a></li>
        <li><a href="${basePath}/home/pay/contact">联系我们</a></li>
    </ul>
    <div class="f-right nav-right">
        <input type="text" class="seacher-input f-left" placeholder="输入关键字" id="a">
        <a class="seacher-but  f-left" onclick="select()">搜索</a>
        <%--<input type="button" class="seacher-but  f-left" value="搜索"  onclick="select()">--%>
    </div>
</div>


<div class="swiper-container section ad-img">
    <div class="swiper-wrapper">

        <div class="swiper-slide">
            <a href="http://www.baidu.com" target="_blank"> <img
                    src="${basePath}/public/images/brand.jpg"></a>
        </div>

        <div class="swiper-slide">
            <a href="http://www.baidu.com" target="_blank"> <img
                    src="${basePath}/public/images/brand.jpg"></a>
        </div>
    </div>
</div>


<div class="section new-goods-main" >
    <div class="new-goods-header">
        新品产品  <a class="more-goods f-right" href="#">更多+</a>
    </div>
    <c:forEach items="${list}" var="m">
        <ul class="img-list">
            <li>
                <a title="${m.goodsName}" href="${basePath}/home/homepage/productDetail?id=${m.id}">
                    <div class="img-box">
                        <img src="${basePath }/public/images${m.goodsImg}">
                    </div>
                    <div class="info">
                        <h3>${m.goodsName}</h3>
                        <p>
                            <strong>人气 ${m.clickCount}</strong>
                            <span class="price">${m.sellPrice}</span>
                        </p>
                    </div>
                </a>
            </li>
        </ul>
    </c:forEach>
</div>

<div class="section new-goods-main" >
    <div class="new-goods-header">
        热销产品  <a class="more-goods f-right" href="#">更多+</a>
    </div>
    <c:forEach items="${list}" var="m">
        <ul class="img-list">
            <li>
                <a title="${m.goodsName}" href="${basePath}/home/homepage/productDetail?id=${m.id}">
                    <div class="img-box">
                        <img src="${basePath }/public/images${m.goodsImg}">
                    </div>
                    <div class="info">
                        <h3>${m.goodsName}</h3>
                        <p>
                            <strong>人气 ${m.marketPrice}</strong>
                            <span class="price">${m.sellPrice}</span>
                        </p>
                    </div>
                </a>
            </li>
        </ul>
    </c:forEach>
</div>



<div class="section qitian-main">
    <img src="${basePath }/public/images/qitian.png">
</div>

<div class="footer-copyright">
    <p>软信商城2013-2017 软信大学版权所有 京ICP备17017089号 京公网安备11000002000006号</p>
</div>
</body>
</html>
